/*
 * Copyright (c) 2014 laidian. All Rights Reserved.
 * @author yaoyuming
 * @date  2020-07-16 13:53
 */
package com.yao.sys.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yao.common.annotation.User;
import com.yao.common.helper.ValidateHelper;
import com.yao.common.resp.ApiResponse;
import com.yao.sys.service.AuthService;

/**
 * 权限管理
 * @author yaoyuming
 * @date 2020/07/16 13:53
 */
@RestController
@RequestMapping("/auth")
public class AuthController {

    @Autowired
    private AuthService authService;


    @GetMapping("/listMenuTree")
    public ApiResponse<Void> listUserMenuTree(@User Integer userId){

        ValidateHelper.validateId(userId);

        return ApiResponse.success(authService.listMenuTree(userId));
    }

}